<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-28
 * Time: 11:16
 */

namespace app\api\model;


use think\model\concern\SoftDelete;

class Goods extends BaseModel
{
    use SoftDelete;

    // 关联
    public function images()
    {
        return $this->hasMany('GoodsImage','goods_id','id')->order('id desc');
    }

    public function image()
    {
        return $this->belongsTo('GoodsImage','id','goods_id');
    }
}